Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CI #382

Merged
merged 8 commits into from
Aug 7, 2023
Merged

Upgrade CI #382

merged 8 commits into from
Aug 7, 2023

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Aug 5, 2023

  • Improves naming conventions a little
  • Factors out code coverage into its own single job (results in overall speed improvement for CI)
  • Adds workflow for analyzing the code with GitHub's CodeQL. Initial commit purposely leaves out the additional permission requirement for the token so it can't open any security complaints on the repo yet.

@gwynne gwynne requested a review from fabianfett August 5, 2023 12:19
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2023

Codecov Report

Merging #382 (5fca673) into main (3561175) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #382   +/-   ##
=======================================
  Coverage   46.88%   46.88%           
=======================================
  Files         110      110           
  Lines        8988     8988           
=======================================
  Hits         4214     4214           
  Misses       4774     4774           

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment on lines 162 to 172
code-coverage:
runs-on: ubuntu-latest
container: swift:jammy
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Run unit tests for coverage data
run: swift test --filter=^PostgresNIOTests --enable-code-coverage
- name: Upload coverage data
uses: vapor/[email protected]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you move code cov into its own job? why isn't this part of unit testing anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I did some digging into what actually results from providing the code coverage from every unit test variant. The results are always identical (except where there are Swift- or DB-version dependent semantics that are touched by unit tests, which is extremely rare right across all of Vapor). In short, it slows down each individual variant (both the build and the execution, enough to be easily measurable in some cases) and provides nowhere near enough valuable data to be worth the trouble even in CI. Splitting it out to its own run adds another job, yes, but that job doesn't need to have TSan enabled; in most repos the end result is the overall time taken to run CI goes down, despite using the additional queue slot.

And on a minor note, Codecov's backend seems to appreciate not having to process 20 identical uploads for every single push to a PR; the upload failure rate drops from ~4% to literally zero (at least as observed thus far). On, and for good measure, the additional env vars that were being included with the uploads don't seem to be visible anywhere in Codecov's interface, so even where there were differences between coverage on a per-variant basis, you couldn't tell which was which anyway.

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Thanks!

@fabianfett fabianfett merged commit dcf78b0 into main Aug 7, 2023
13 checks passed
@fabianfett fabianfett deleted the gwynne-patch-1 branch August 7, 2023 10:03
@fabianfett fabianfett added the semver-noop No version bump required. label Aug 7, 2023
gwynne added a commit that referenced this pull request Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-noop No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants